@extends('front.common.header')

@section('title',$result->title.' - 青苜社区')

@section('head')
	 @parent
@stop

@section('content')
<link rel="stylesheet" type="text/css" href="{{ asset('/css/bbs/index.css') }}" />
<link href="{{ asset('/css/company/jobs.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset('/css/company/comdetails.css') }}" rel="stylesheet" type="text/css">
	<div class="first_center">
	    <div class="heade_m">
	    	<ul>
	    		<li style="width: 70px; text-align: center"><a href="{{ url('/bbs') }}">首页</a></li>
	    		<li><span>|</span></li>
	    		{{--<li style="width: 70px; text-align: center"><a href="{{ url('/bbs/list') }}" target="_blank">版块</a></li>
                <li><span>|</span></li>--}}
                <li style="padding:0 10px;text-align: center"><a href="javascript:void(0)">{{$result->title}}</a></li>
            </ul>
            <div class="search fr" style="">
                <input type="text" id="bbs_keyword" name="keyword" class="bbs_keyword" placeholder="搜索话题和用户" value="">
                <input type="submit" id="bbs_searchbtn" value="" />
            </div>
            <script type="text/javascript">
			$(function(){
				$("#bbs_searchbtn").click(function(){
			        var kw = $("#bbs_keyword").val();
			        if(kw.length != 0){
			            window.location.href = '/bbs/search/'+kw;
			        }
			    });
			});
            </script>
            <div class="clr"></div>
	    </div>
		<div class="first_min">
			<div id="board_left" class="fl mr20 pb15">
                <div class="bbs-filter-line bbsnav">
                   <div class="bbs-filter fl">
                       <ul class="bbs-filter-select">
                           <li><a href="/bbs/board/{{$categoryid}}?type={{0}}&sort={{0}}" class="@if(Input::get('type') == 0)pl5 pr20 current @else pl5 pr20 @endif">全部</a></li>
                           <li>|</li>
                           <li><a href="/bbs/board/{{$categoryid}}?type={{1}}&sort={{$now_sort}}" class="@if(Input::get('type') == 1)pl20 pr20 current @else pl20 pr20 @endif">推荐</a></li>
                           <li>|</li>
                           <li><a href="/bbs/board/{{$categoryid}}?type={{2}}&sort={{$now_sort}}" class="@if(Input::get('type') == 2)pl20 pr20 current @else pl20 pr20 @endif">热门</a></li>
                           <li class="ml25">
                               <a id="showmsg" class="pl30" href="" onmouseover="mopen('dropdown')" onmouseout="mclosetime()">
                                   排序方式
                               <span class="bg"></span>
                               </a>
                               <div id="dropdown" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
                                 <a href="/bbs/board/{{$categoryid}}?type={{$now_type}}&sort={{0}}" class="@if(Input::get('sort') == 0)current @endif">默认排序</a>
                                 <a href="/bbs/board/{{$categoryid}}?type={{$now_type}}&sort={{1}}" class="@if(Input::get('sort') == 1)current @endif">发帖时间</a>
                                 <a href="/bbs/board/{{$categoryid}}?type={{$now_type}}&sort={{2}}" class="@if(Input::get('sort') == 2)current @endif">回复/阅读</a>
                                 <a href="/bbs/board/{{$categoryid}}?type={{$now_type}}&sort={{3}}" class="@if(Input::get('sort') == 3)current @endif">阅读数</a>
                                 <a href="/bbs/board/{{$categoryid}}?type={{$now_type}}&sort={{4}}" class="@if(Input::get('sort') == 4)current @endif">最新回复</a>
                                 <a href="/bbs/board/{{$categoryid}}?type={{$now_type}}&sort={{5}}" class="@if(Input::get('sort') == 5)bbn current @else bbn @endif">热度</a>
                               </div>
                           </li>
                       </ul>
                   </div>
                   <div class="bbs-post fr">
                       <a @if(!empty($authuser)) href="{{url('/bbs/post?cid='.$categoryid)}}" @else href="javascript:void(0)" onclick="loginTips()"@endif>我要发帖</a>
                   </div>
                   <div class="clr"></div>
                </div>
                @if($now_type == 1 || ($now_type == 0 && $now_sort == 0 ))
                @if(!empty($hotquestion))
                <div id="bbs-recommend-list" class="bbs-recommend-list">
                   @foreach ($hotquestion as $key => $hotq)
                   <div class="bbs-filter-line bbslist">
                     <div class="logopic fl">
                        <a href="{{url('/bbs/'.$hotq->id)}}">
                           <img src="{{$hotq->userlogo}}">
                        </a>
                     </div>
                     <div class="bbs-info-tit fs16 fwb fl">
                        <a href="{{url('/bbs/'.$hotq->id)}}" class="fs16">
                            {{$hotq->titname}}
                        </a>
                     </div>
                     <div class="bbs-info-r fs14 c9 fr mr10">
                        <p>{{$hotq->username}}</p>
                        <p>{{$hotq->createdtime}}</p>
                     </div>
                     <div class="clr"></div>
                  </div>
                  @endforeach
                </div>
                @endif
                @endif
                @if($now_type == 0 && $now_sort == 0 )
                <div class="bbs-filter-line bbslistb">
                   <div class="fl ml10 mr10 cp" id="msg-refresh" onclick="bbsrefresh('{{$categoryid}}');">
                       <span class="fs16 c3">板块主题</span>
                       <span class="ml10">
                         <img src="{{ asset('/images/front/repeat.png') }}">
                       </span>
                   </div>
                   @if(count($newanswer) > 0)
                   <div class="fr mr10 cp" id="msg-answer" onclick="bbsrefresh('{{$categoryid}}');">
                       <span ><img src="{{ asset('/images/front/sound.png') }}"></span>
                       <span style="color: #ff6204;">有个新回复的主题 点击查看</span>
                   </div>
                   @endif
                   <div class="clr"></div>
                </div>
                @endif
                @if($now_type != 1)
                <div id="bbs-bottom-list" class="bbs-bottom-list">
                    @foreach ($question as $key => $ques)
                    <div class="bbs-filter-line bbslist">
                        <div class="logopic fl">
                            <a href="{{url('/bbs/'.$ques->id)}}">
                                <img src="{{$ques->userlogo}}">
                            </a>
                        </div>
                        <div class="bbs-info-tit fs16 fwb fl">
                            <a href="{{url('/bbs/'.$ques->id)}}" class="fs16">{{$ques->titname}}</a>
                        </div>
                        <div class="bbs-info-r fs14 c9 fr mr10">
                            <p>{{$ques->username}}</p>
                            <p>{{$ques->createdtime}}</p>
                        </div>
                        <div class="clr"></div>
                    </div>
                    @endforeach
                </div>
                <div class="getmore">
                    <a href="javascript:void(0)" id="getMore">继续加载...</a>
                    <input type="hidden" name="pages" value="{{$pages}}" />
                </div>
                <script>
                    $(function(){
                        $("#getMore").click(function(){
                            var p = $("input[name=pages]").val();
                            var type = "{{ Input::get('type')}}";
                            var sort = "{{ Input::get('sort')}}";
                            $.ajax({
                                type:'GET',
                                url:'/bbs/board/{{$categoryid}}?',
                                data:"page="+p+"&type="+type+"&sort="+sort,
                                dataType:'json',
                                success:function(data){
                                    if(data.status == 'success'){
                                        var result = data.data;
                                        var html = '';
                                        $.each(result,function(k,e){
                                            html += '<div class="bbs-filter-line bbslist">'
                                                +'    <div class="logopic fl">'
                                                +'       <a href="/bbs/'+e.id+'">'
                                                +'           <img src="'+e.userlogo+'">'
                                                +'       </a>'
                                                +'     </div>'
                                                +'     <div class="bbs-info-tit fs16 fwb fl">'
                                                +'       <a href="/bbs/'+e.id+'" class="fs16 c3">'+e.titname+'</a>'
                                                +'     </div>'
                                                +'     <div class="bbs-info-r fs14 c9 fr mr10">'
                                                +'       <p>'+e.username+'</p>'
                                                +'       <p>'+e.createdtime+'</p>'
                                                +'     </div>'
                                                +'     <div class="clr"></div>'
                                                +'    </div>';
                                        });
                                        $("input[name=pages]").val(data.pages);
                                        $('#bbs-bottom-list').append(html);
                                    }else{
                                        $("#getMore").html(data.msg);
                                    }
                                }
                            });
                        });
                    })
                </script>
                @endif
			</div>
            <div id="board_right" class="fl">
                {{--<div class="first_min_right_qd">
                    <img src="{{ asset('/images/front/qd-bg.png') }}" />
                    <span>签到</span>
                </div>
                <div class="first_min_right_jf">
                    <img src="{{ asset('/images/front/jf_bg.png') }}" />
                    <span>+5积分</span>
                </div>--}}
                <div class="first_min_right_qd">
					<img style="width: 295px;height: 151px;" src="{{ asset('/images/front/bbs-sign.jpg') }}" />
				</div>
                <div class="first_min_right_top">
                    <a @if(!empty($authuser)) href="{{url('/bbs/post?cid='.$categoryid)}}" @else href="javascript:void(0)" onclick="loginTips()"@endif>我要发帖</a>
                </div>
                <div class="board-info">
                    <h4>板块信息</h4>
                    <p class="first fs16 c3">版主：admin</p>
                    <div class="board-info-detail">
                        {!!$result->detail !!}
                    </div>
                </div>
                <div class="board-info-hot">
                    <h4>社区热帖</h4>
                    @foreach($hotpost as $key=>$hotp)
                    <p>&bull;<a href="{{url('/bbs/'.$hotp->id)}}">{{str_limit($hotp->title,28)}}</a></p>
                    @endforeach
                </div>
                <div class="board-info-hot">
                    <h4>热门精华</h4>
                    @foreach($hotemploy as $key=>$hote)
                    <p>&bull;
                        <a href="{{ url('/employ/'.$hote->id) }}" title="{{$hote->title}}">
                            {{str_limit($hote->title,22)}}
                        </a>
                    </p>
                    @endforeach
                </div>
                <div class="board-info-hot">
                    <h4>热门课程</h4>
                    @foreach($hotteaches as $key=>$hott)
                    <p>&bull;
                        <a href="{{url('/teaches/'.$hott->id)}}" title="{{$hott->name}}">
                            {{str_limit($hott->name,28)}}
                        </a>
                    </p>
                    @endforeach
                </div>
            </div>
			</div>
            <div class="clr"></div>
		</div>
	</div>
<script type="text/javascript">
    var timeout         = 500;
    var closetimer		= 0;
    var menuitem      = 0;
    function mopen(id)
    {
        mcancelclosetime();
        if(menuitem) menuitem.style.visibility = 'hidden';
        menuitem = document.getElementById(id);
        menuitem.style.visibility = 'visible';
    }
    function mclose()
    {
        if(menuitem){
            menuitem.style.visibility = 'hidden';
        }
    }
    function mclosetime()
    {
        closetimer = window.setTimeout(mclose, timeout);
    }
    function mcancelclosetime()
    {
        if(closetimer)
        {
            window.clearTimeout(closetimer);
            closetimer = null;
        }
    }
    document.onclick = mclose;
</script>
@stop

@section('footer')
	@parent
@stop

